<?php
JunctionFileCabinet::using("Junction_Core_Mapping");
JunctionFileCabinet::using("Test_Mock_CoreIterator");

class Test_Mock_Mapping extends Junction_Core_Mapping {
	
	private $_properties;
	
	public function __construct() {
		$this->_properties = array();
		$this->_properties["Id"] = "id";
		$this->_properties["Email"] = "email";
		$this->_properties["Password"] = "password";
		$this->_properties["Date"] = "date_created";
	}
	
	public function translate($column) {
		return $this->_properties[$column];
	}
	
	public function contains($property) {
		return (isset($this->_properties[$property]));
	}
	
	public function loadBy($clause) {
		return new Test_Mock_CoreIterator($this);
	}
	
	public function save($object) {
		return true;
	}
	
	public function deleteBy($clause) {
		return 1;
	}
	
	public function makeClientFrom(array $data) {
		$result = new Test_Mock_Client();
		$result->setDate(time());
		$result->setEmail("foo@bar.com");
		$result->setId(1);
		$result->setPassword("password");
		return $result;
	}
}
?>